package com.example.blueconn.views;

import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;

import com.example.blueconn.R;
import com.example.blueconn.utils.DensityUtils;

/**
 * Created by zhudongao
 * Desc
 * Date 5/4/21
 */

public class ShapeLayout extends LinearLayout {

    private Paint paint;

    public ShapeLayout(Context context) {
        this(context, null);
    }

    public ShapeLayout(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public ShapeLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init();
    }

    private void init() {
        paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        paint.setColor(ContextCompat.getColor(getContext(), R.color.black));
        paint.setStrokeWidth(DensityUtils.dp2px(5));
        paint.setStyle(Paint.Style.STROKE);
    }
}
